Skip to content

Settings page regression tests (4/6): Integrations tab - #136

Open
conatus wants to merge 3 commits into
admin-e2e-membership-plansfrom
admin-e2e-integrations
Open

conatus wants to merge 3 commits into
admin-e2e-membership-plansfrom
admin-e2e-integrations

Conversation

@conatus

@conatus conatus commented Oct 24, 2026

Copy link
Copy Markdown
Member

Fourth of the settings page regression test PRs. Stacked on #135 (Membership Plans) → #134 → #133.

Covers every setting on the Integrations tab. Each test changes the setting on the settings page, reads it back through Settings::get, and checks its effect against fakes of the real services. A legacy test loads the tab as Carbon Fields stored it.

What's covered

CRMs, Auth0 and webhooks (integrations-crm.spec.ts). Each test joins through the real join form: the form's /join request is caught at its last step and passed to the plugin unchanged.

  • Zetkin:
    • Without OAuth, the join form submission goes to the organisation and form set here, with the token.
    • The membership tier and join date custom fields are sent only when set.
    • Sandbox (the default) and live use Zetkin's dev and live servers respectively.
    • With OAuth credentials, the plugin signs in with the client ID, secret and JWT, adds the person and tags them.
  • Mailchimp: the member goes to the audience set here, with the API key; the key's suffix picks the server.
  • Action Network: the member is added with the API key set here.
  • Join Complete Webhook URL: the join is posted to it without bank details. The form only ever sees a UUID, never the URL.
  • Step Webhook Url: each step is posted to it, again without bank details.
  • Auth0: the account is created with the credentials and audience set here, using the member's password.

Payments and postcodes (integrations-payments.spec.ts)

  • Stripe:
    • Direct debit on gives card + Bacs; Direct Debit only gives Bacs only; off gives card only. Checked as the payment methods Stripe's fields are set up with.
    • Direct Debit only is hidden, and dropped on save, unless direct debit is on.
    • Download Subscriptions produces the expected CSV, reading Stripe with the secret key, and is admin-only.
  • GoCardless: members are sent to GoCardless's billing flow, set up with the access token. Sandbox and live use different APIs.
  • Chargebee: with hosted pages on, card payments go to a Chargebee page created with the site and API key. With it off, card details are taken in the form.
  • Postcode lookup:
    • Off by default.
    • getAddress.io finds addresses and fills in the chosen one.
    • Ideal Postcodes finds addresses.
    • Each provider is refused without its key.

Logging services (integrations-logging.spec.ts)

  • By default, logs go to disk only.
  • Loggly: logs go there instead of to disk, tagged with Loggly Tags (default join-block). The Logging tab says so.
  • Sentry: errors (not info) reach Sentry, and the join form is set up with the same DSN.
  • Google Cloud Logging: logs reach the project's log, signed in as the key file's service account.

Supporting changes

  • Fake API:
    • A small in-memory Zetkin.
    • OAuth token answers for Auth0 and Google.
    • Stripe invoices.
    • gzip request bodies (Sentry sends them).
    • New hostnames for Loggly, Sentry and Google, so the test certificate was regenerated.
    • Also reachable as http://fake-api, for webhook URLs.
  • The Chargebee PHP SDK now trusts the test CA, like the Stripe SDK.
  • stubStripe() (new) and a fuller stubChargebee() stand in for Stripe.js and Chargebee.js, so the payment steps render offline.
  • joinThroughForm(), JoinSettingsPage.setSelect().
  • Docs: coverage table and fake API section.

Problem found

  • JOIN-167: Download Subscriptions writes a PHP warning into the CSV when a Stripe list (e.g. invoices) is empty. There's a skipped test for it; I checked it fails when enabled.

Testing

Locally, all of tests/settings: 122 passed, 6 skipped (the known-problem tests).


Generated by Claude Code

Covers every Integrations setting: joins through the real join form reach
Zetkin, Mailchimp, Action Network, Auth0 and the webhooks with the
credentials set on the page; Stripe direct debit options and the
subscriptions download; GoCardless and Zetkin sandbox/live; Chargebee
hosted pages; postcode lookups; and Sentry, Google Cloud Logging and Loggly
receiving the plugin's logs. A legacy fixture checks settings stored by
Carbon Fields still work.

The fake API gains a small Zetkin, token endpoints for Auth0 and Google,
Stripe invoices, gzip bodies, and hostnames for the logging services. The
Chargebee SDK now trusts its test CA, and stand-ins for Stripe.js and
Chargebee.js let the payment steps render.

The subscriptions download breaking with no Stripe invoices (JOIN-167) is
a skipped test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
Comment thread packages/join-e2e/fake-api/server.js Resolved
Comment thread packages/join-e2e/fake-api/server.js Resolved
Comment thread docs/e2e-testing.md Resolved

@conatus conatus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supplementary review: one spec reaches past JoinSettingsPage into Carbon Fields markup. This adds to the inline findings already posted.


Generated by Claude Code

# Conflicts:
#	docs/e2e-testing.md
#	packages/join-e2e/tests/settings/fixtures.ts
- Fake API: a request body that won't gunzip is recorded as it came
  instead of crashing the fake. The unused Google token endpoint, its
  network alias and certificate name are gone (the Google client signs
  its own token).
- Zetkin: checks the Unconfirmed tag is put on the person the API created.
- Action Network: checks the other plan's tags and the lapsed, cancelled
  and lapsing tags are removed. It also sends an empty tag when a plan has
  no Add Tags: a skipped test for JOIN-171.
- Step Webhook Url: the step now comes from the real join form, with /step
  let through to the plugin rather than posted by the test.
- Subscriptions download: the secret key is checked on the export's own
  Stripe reads, not on requests made when the settings were saved.
- Join dates are checked against the dates either side of the join, so a
  run across midnight still passes.
- The legacy fixture sets Loggly, and checks a join's logs reach it with
  the legacy tags.
- continueToPlans/continueToPayment live in fixtures.ts, shared by the
  specs that had their own copies.
- No Carbon Fields class in the logging spec.
- Readme lists the logging services the fake stands in for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
@conatus conatus changed the title Settings page regression tests: Integrations tab Settings page regression tests (4/6): Integrations tab Oct 25, 2026
@linear-code

linear-code Bot commented Oct 25, 2026

Copy link
Copy Markdown

JOIN-173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants